package com.atguigu.spzx.cloud.order.feign;

import com.atguigu.spzx.cloud.user.entity.User;
import org.springframework.stereotype.Component;

/**
 * projectName: com.atguigu.spzx.cloud.order.feign
 *
 * @author: 顾司羽
 * time: 2024/12/25 20:59 周三
 * description:
 */
@Component
public class UserServiceFallback implements UserFeignClient{

    //调用findUserById远程方法报错，触发了降级处理
    //返回一个默认值
    @Override
    public User findUserByUserId(Long userId) {
        System.out.println("服务触发了降级处理了！！");
        User user = new User();
        user.setId(userId);
        return user;
    }
}
